package com.mlethe.android.demo;

import androidx.multidex.MultiDexApplication;

import com.mlethe.android.demo.recyclerview.adapter.callback.EmptyCallback;
import com.mlethe.android.demo.recyclerview.adapter.callback.ErrorCallback;
import com.mlethe.android.demo.recyclerview.adapter.callback.FooterLoadCallback;
import com.mlethe.android.demo.recyclerview.adapter.callback.FooterLoadCallback2;
import com.mlethe.android.demo.recyclerview.adapter.callback.LoadingCallback;
import com.mlethe.library.app.ProjectInit;
import com.mlethe.library.recyclerview.AdapterLoadSir;
import com.mlethe.library.utils.file.FileUtil;

//import com.mlethe.library.socialtool.SocialTool;

public class MApplication extends MultiDexApplication {
    @Override
    public void onCreate() {
        super.onCreate();
        //全局异常捕获
        FileUtil.init(this);
        KqwException handler = KqwException.getInstance();
        Thread.setDefaultUncaughtExceptionHandler(handler);
//        AutoSizeConfig.getInstance().setExcludeFontScale(true);
        AdapterLoadSir.beginBuilder()
                .addCallback(new EmptyCallback())
                .addCallback(new ErrorCallback())
                .addCallback(new LoadingCallback())
                .addCallback(new FooterLoadCallback())
                .addCallback(new FooterLoadCallback2())
                .setDefaultCallback(LoadingCallback.class)
                .setDefaultLoadCallback(FooterLoadCallback.class)
                .commit();
        /*SocialTool.init(this)
                .setAlipay("2016101000652462", "2088102178921791", "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC4cdadD1iMSz1KBbG1z4QXb0zVcaJ/mtKFu9wUrOxUrjoiTrzo3BV8EncZsCdJzO/0SiifuaRs82eVh93wkrUZKtK6s4CrOT4+S/10kGqxPJDugJkWEl52tvrVf8UCYUm+BCIEhSfmpNWg/l7oeOQV7wER4XhdQggVtjMGKToeFAoAwU2GdN1w3vCMQ5Lv0hAqw9KjQyz2zLM2kYhmICeNCndIb0zEjrfDr5qDzdKq/ZHFMfL1zjy6S4l7nkeHP2vGm5TeNb9SXzVbIIu6i/Xaka8QXEkWU3v71ykR9OQnk27K2/ytydIQ1wBwRT4JhsFTZX5RTkl3CYeMA29jPa6RA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wEiHyQmqgMV2MgmAUiAJJlT1W7Jzq0P/vdmr/vQ1Ig2EuWb+DuBGwwXwK+xIlUWHeHcsaeZsCT5YM0xDF4GbR11vHejKzgkXZTt+yULlc1FomHDtpEtDLcFFcvkeBYHQtG0wMZ28VIiJBXZ2brXepmOBbq6betJLG")
                .setAlipay("2015060900117932")
                .setWechat("wxd930ea5d5a258f4f", "1d6d1d57a3dd063b36d917bc0b44d964")
                .setQQ("222222")
                .setQQ("100619284")
                .setUnionPay("fd6505537cfd4efd84414c38e8072ef2")
                .setWeibo("2045436852", "http://www.sina.com");*/
        ProjectInit.init(this)
                .withApiHost("https://huaxi.yunlingrobot.com/", "http://wx.sjhn520.com/")
                .setLogEnable(true)
                .configure();
    }

    @Override
    public void onTerminate() {
//        SocialTool.release();
        super.onTerminate();
    }
}
